package scau.zhong.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import scau.zhong.common.genid.UUIdGenId;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;

@Data
@Table(name = "role")
public class Role implements GrantedAuthority {
    @Id
    @KeySql(genId = UUIdGenId.class)
    private String id;
    private String roleName;
    private String roleDesc;

    @JsonIgnore
    @Override
    public String getAuthority() {
        return this.roleName;
    }
}
